<?php
namespace App\Services\Banners;

use App\Model\Banners;
use App\Services\CommonService;

class BannersService extends CommonService
{
    /**
     * @param $banners_type
     * @return \Illuminate\Http\JsonResponse
     * 动态查看
     */
    public function sel(&$banners_type)
    {
        //查看
        $BannersInfo=Banners::orderBy("banner_sort","desc")
            ->where("banner_type",$banners_type)
            ->get()
            ->toarray();

        //查询失败
        if($BannersInfo===array())
        {
            return $this->fail(201,'查询数据失败');
        }
        //返回正确数据
        return $this->success($BannersInfo);
    }
}